home *** CD-ROM | disk | FTP | other *** search
/ Power Programmierung 2 / Power-Programmierung CD 2 (Tewi)(1994).iso / gnu / gnulib / ghostscr / dosstore.h < prev    next >
Encoding:
C/C++ Source or Header  |  1990-12-31  |  2.5 KB  |  63 lines

  1. /* Copyright (C) 1989 Aladdin Enterprises.  All rights reserved.
  2.    Distributed by Free Software Foundation, Inc.
  3.  
  4. This file is part of Ghostscript.
  5.  
  6. Ghostscript is distributed in the hope that it will be useful, but
  7. WITHOUT ANY WARRANTY.  No author or distributor accepts responsibility
  8. to anyone for the consequences of using it or for whether it serves any
  9. particular purpose or works at all, unless he says so in writing.  Refer
  10. to the Ghostscript General Public License for full details.
  11.  
  12. Everyone is granted permission to copy, modify and redistribute
  13. Ghostscript, but only under the conditions described in the Ghostscript
  14. General Public License.  A copy of this license is supposed to have been
  15. given to you along with Ghostscript so you can know your rights and
  16. responsibilities.  It should be in a file named COPYING.  Among other
  17. things, the copyright notice and this notice must be preserved on all
  18. copies.  */
  19.  
  20. /* dosstore.h */
  21. /* Fast assignment macros for MS-DOS machines only */
  22.  
  23. /* See sstorei.h for a discussion of the purpose of the following. */
  24. /* This is in a file of its own so that non-DOS compilers */
  25. /* don't encounter the pragma directive. */
  26.  
  27. #pragma inline
  28. #ifdef FOR80386                /* use 32-bit moves */
  29. /* 66h is the operand size prefix */
  30. #  define s_store_b(pto,ito,pfrom,ifrom)\
  31.    {    asm les bx,dword ptr pfrom;\
  32.     asm db 66h; asm mov ax,es:[bx+((ifrom)*8)];\
  33.     asm db 66h; asm mov cx,es:[bx+((ifrom)*8)+4];\
  34.     asm les bx,dword ptr pto;\
  35.     asm db 66h; asm mov es:[bx+((ito)*8)],ax;\
  36.     asm db 66h; asm mov es:[bx+((ito)*8)+4],cx;\
  37.    }
  38. #  define s_store_r(pboth,ito,ifrom)\
  39.    {    asm les bx,dword ptr pboth;\
  40.     asm db 66h; asm mov ax,es:[bx+((ifrom)*8)];\
  41.     asm db 66h; asm mov cx,es:[bx+((ifrom)*8)+4];\
  42.     asm db 66h; asm mov es:[bx+((ito)*8)],ax;\
  43.     asm db 66h; asm mov es:[bx+((ito)*8)+4],cx;\
  44.    }
  45. #else
  46. #  define s_store_b(pto,ito,pfrom,ifrom)\
  47.    {    asm les bx,dword ptr pfrom;\
  48.     asm mov ax,es:[bx+((ifrom)*8)]; asm mov cx,es:[bx+((ifrom)*8)+2];\
  49.     asm mov dx,es:[bx+((ifrom)*8)+4]; asm push es:[bx+((ifrom)*8)+6];\
  50.     asm les bx,dword ptr pto;\
  51.     asm mov es:[bx+((ito)*8)],ax; asm mov es:[bx+((ito)*8)+2],cx;\
  52.     asm mov es:[bx+((ito)*8)+4],dx; asm pop es:[bx+((ito)*8)+6];\
  53.    }
  54. #  define s_store_r(pboth,ito,ifrom)\
  55.    {    asm les bx,dword ptr pboth;\
  56.     asm mov ax,es:[bx+((ifrom)*8)]; asm mov cx,es:[bx+((ifrom)*8)+2];\
  57.     asm mov es:[bx+((ito)*8)],ax; asm mov es:[bx+((ito)*8)+2],cx;\
  58.     asm mov ax,es:[bx+((ifrom)*8)+4]; asm mov cx,es:[bx+((ifrom)*8)+6];\
  59.     asm mov es:[bx+((ito)*8)+4],ax; asm mov es:[bx+((ito)*8)+6],cx;\
  60.    }
  61. #endif
  62. #define s_store_i(pto,pfrom) s_store_b(pto,0,pfrom,0)
  63.